import XEUtils from 'xe-utils';
import customConfig from './custom-config';
import defaultConfig from './default-config';

/**
 * 获取配置的主题样式
 *
 * @returns Object 配置信息
 */
export const getThemeConfig = () => {
	let result = { ...defaultConfig, ...customConfig };
	if (import.meta.env.VITE_CUSTOM_THEME_CONFIG) {
		const envConfig = JSON.parse(import.meta.env.VITE_CUSTOM_THEME_CONFIG);
		result = { ...result, ...envConfig };
	}
	return XEUtils.clone(result, true);
};
